import { createApp } from 'vue'
import './styles/index.css'
import App from './App.vue'
import { createPinia } from 'pinia'

/*
  步骤了解
  1：下载  yarn add pinia
  2:在main.ts导入  
     import {createPinia} from 'pinia'
  3:在Vue上挂载
    vue2  new Vue({store})
    vue3  createApp(App).use(createPinia()).mount('#app')
  4:定义模块
      src/store/模块名.ts
      import {defineStore} from 'pinia'
      export const useXxx=defineStore('模块名',()=>{
         
        // state
        const count=ref(0)
        // getters
        const getCount=computed(()=>{
            return count.value*2
        })
        // actions
        const setCount=(x:number)=>{
            count.value=x
        }
      return {count,getCount,setCount}
      },{
        // 配制
      })

  5:使用
     导入模块
      import {useXxx} from '路径'
      const store=useXxx()
      store.count
      store.getCount
      store.setCount
*/

createApp(App).use(createPinia()).mount('#app')
